package com.atomone.epublib.model.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.atomone.epublib.model.BookHelpfulBean;
import com.atomone.epublib.model.BookRecordBean;
import com.atomone.epublib.model.BookReviewBean;
import com.atomone.epublib.model.CollBookBean;
import com.atomone.epublib.model.ReviewBookBean;

import com.atomone.epublib.model.dao.BookHelpfulBeanDao;
import com.atomone.epublib.model.dao.BookRecordBeanDao;
import com.atomone.epublib.model.dao.BookReviewBeanDao;
import com.atomone.epublib.model.dao.CollBookBeanDao;
import com.atomone.epublib.model.dao.ReviewBookBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig bookHelpfulBeanDaoConfig;
    private final DaoConfig bookRecordBeanDaoConfig;
    private final DaoConfig bookReviewBeanDaoConfig;
    private final DaoConfig collBookBeanDaoConfig;
    private final DaoConfig reviewBookBeanDaoConfig;

    private final BookHelpfulBeanDao bookHelpfulBeanDao;
    private final BookRecordBeanDao bookRecordBeanDao;
    private final BookReviewBeanDao bookReviewBeanDao;
    private final CollBookBeanDao collBookBeanDao;
    private final ReviewBookBeanDao reviewBookBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        bookHelpfulBeanDaoConfig = daoConfigMap.get(BookHelpfulBeanDao.class).clone();
        bookHelpfulBeanDaoConfig.initIdentityScope(type);

        bookRecordBeanDaoConfig = daoConfigMap.get(BookRecordBeanDao.class).clone();
        bookRecordBeanDaoConfig.initIdentityScope(type);

        bookReviewBeanDaoConfig = daoConfigMap.get(BookReviewBeanDao.class).clone();
        bookReviewBeanDaoConfig.initIdentityScope(type);

        collBookBeanDaoConfig = daoConfigMap.get(CollBookBeanDao.class).clone();
        collBookBeanDaoConfig.initIdentityScope(type);

        reviewBookBeanDaoConfig = daoConfigMap.get(ReviewBookBeanDao.class).clone();
        reviewBookBeanDaoConfig.initIdentityScope(type);

        bookHelpfulBeanDao = new BookHelpfulBeanDao(bookHelpfulBeanDaoConfig, this);
        bookRecordBeanDao = new BookRecordBeanDao(bookRecordBeanDaoConfig, this);
        bookReviewBeanDao = new BookReviewBeanDao(bookReviewBeanDaoConfig, this);
        collBookBeanDao = new CollBookBeanDao(collBookBeanDaoConfig, this);
        reviewBookBeanDao = new ReviewBookBeanDao(reviewBookBeanDaoConfig, this);

        registerDao(BookHelpfulBean.class, bookHelpfulBeanDao);
        registerDao(BookRecordBean.class, bookRecordBeanDao);
        registerDao(BookReviewBean.class, bookReviewBeanDao);
        registerDao(CollBookBean.class, collBookBeanDao);
        registerDao(ReviewBookBean.class, reviewBookBeanDao);
    }
    
    public void clear() {
        bookHelpfulBeanDaoConfig.clearIdentityScope();
        bookRecordBeanDaoConfig.clearIdentityScope();
        bookReviewBeanDaoConfig.clearIdentityScope();
        collBookBeanDaoConfig.clearIdentityScope();
        reviewBookBeanDaoConfig.clearIdentityScope();
    }

    public BookHelpfulBeanDao getBookHelpfulBeanDao() {
        return bookHelpfulBeanDao;
    }

    public BookRecordBeanDao getBookRecordBeanDao() {
        return bookRecordBeanDao;
    }

    public BookReviewBeanDao getBookReviewBeanDao() {
        return bookReviewBeanDao;
    }

    public CollBookBeanDao getCollBookBeanDao() {
        return collBookBeanDao;
    }

    public ReviewBookBeanDao getReviewBookBeanDao() {
        return reviewBookBeanDao;
    }

}
